package com.zp.demo.repush.listener;

import com.zp.demo.repush.event.RepayPlanEvent;
import com.zp.demo.repush.service.defined.DefindRePushDbService;
import com.zp.demo.repush.service.defined.DefindSaveLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 保存一条日志记录
 * @Author 张鹏
 * @Date 2018/12/29 16:57
 */
@Component
public class AddRePushListener implements ApplicationListener<RepayPlanEvent> {
    @Autowired
    private DefindRePushDbService defindRePushDbService;
    @Override
    public void onApplicationEvent(RepayPlanEvent event) {
        defindRePushDbService.saveRepush2DB(event.getRePushVo(),event.getRePushVo().getStrategyInfo());
    }
}
